import { request } from '../utils/request';
import type { AttackPathData } from '../types/attackPath';

// 获取攻击路径数据
export const getAttackPathData = () => {
  return request.get<AttackPathData>('/attack-path');
};

// 获取攻击路径节点详情
export const getNodeDetail = (nodeId: string) => {
  return request.get<any>(`/attack-path/node/${nodeId}`);
};

// 获取攻击路径关系详情
export const getRelationDetail = (relationId: string) => {
  return request.get<any>(`/attack-path/relation/${relationId}`);
};

// 保存攻击路径数据
export const saveAttackPathData = (data: AttackPathData) => {
  return request.post<any>('/attack-path', data);
}; 